#include "PTreeXLearning.h"

inline bool PTreeX::isEmpty()
{
	return ptree.empty();
}

inline bool PTreeX::checkNode(std::string key)
{
	if (!isEmpty())
		return false;

	if (ptree.find(key) == ptree.not_found())
		return false;
	else
		return true;
}

int PTreeX::getNode(std::string key)
{
	try
	{
		//boost::property_tree::ptree ele = *(this->ptree.find(key));
		if (checkNode(key)) {
			boost::property_tree::ptree ele = ptree;
			while (!ele.empty())
			{
				while (ele.data() != key)
				{
					// todo
					//ele = ele.c
				}
			}
		}
	}
	catch (const std::exception& err)
	{
		std::cout << err.what() << std::endl;
		return -1;
	}
	
	return 0;
}

int PTreeX::addNode()
{
	// todo
	return 0;
}
